package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by HuangMin on 2018/6/28.
 */
public class ProjectFeeChargeNodeEnum {

    /**
     * 担保费收取节点(1:放款时收取,3:还款每期,2:还款首期)
     */
    @Getter
    @AllArgsConstructor
    public enum GuaranteeFeeChargeNode {
        COLLECTION_OF_MONEY((byte)1,"放款时收取"),
        REPAYMENT_FIRST((byte)2,"还款首期"),
        REPAYMENTS_PER_PERIOD((byte)3,"还款每期");

        private Byte value;
        private String desc;

        public static GuaranteeFeeChargeNode enumOf(Byte value) {
            for (GuaranteeFeeChargeNode chargeNode : values()) {
                if (chargeNode.value.equals(value)) {
                    return chargeNode;
                }
            }
            throw new NoSuchEnumValueException("GuaranteeFeeChargeNode:" + value);
        }
    }

    /**
     * 平台管理费收取节点(1:放款时收取,3:还款每期,2:还款首期)
     */
    @Getter
    @AllArgsConstructor
    public enum ManageFeeChargeNode {
        COLLECTION_OF_MONEY((byte)1,"放款时收取"),
        REPAYMENT_FIRST((byte)2,"还款首期"),
        REPAYMENTS_PER_PERIOD((byte)3,"还款每期");

        private Byte value;
        private String desc;

        public static ManageFeeChargeNode enumOf(Byte value) {
            for (ManageFeeChargeNode chargeNode : values()) {
                if (chargeNode.value.equals(value)) {
                    return chargeNode;
                }
            }
            throw new NoSuchEnumValueException("ManageFeeChargeNode:" + value);
        }
    }

    /**
     * 后置咨询服务费收取节点(1:放款时收取,3:还款每期,2:还款首期)
     */
    @Getter
    @AllArgsConstructor
    public enum AfterSeekAdviceServiceFeeChargeNode {
        COLLECTION_OF_MONEY((byte)1,"放款时收取"),
        REPAYMENT_FIRST((byte)2,"还款首期"),
        REPAYMENTS_PER_PERIOD((byte)3,"还款每期");

        private Byte value;
        private String desc;

        public static AfterSeekAdviceServiceFeeChargeNode enumOf(Byte value) {
            for (AfterSeekAdviceServiceFeeChargeNode chargeNode : values()) {
                if (chargeNode.value.equals(value)) {
                    return chargeNode;
                }
            }
            throw new NoSuchEnumValueException("AfterSeekAdviceServiceFeeChargeNode:" + value);
        }
    }


}
